package com.buba.mapper;

import entity.FollowTopic;
import entity.FollowTopicEntity;
import entity.VO.FollowTopicVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: 孔德嘉
 * @Description: TODO
 * @DateTime: 2023/3/6 19:01
 **/
@Mapper
public interface FollowTopicMapper {
    /*
     * @param id
     * @return result.CommonResult
     * @author kdj
     * @describe:查询关注的话题
     * @date 2023/3/6 17:02
     */
    List<FollowTopicVO> getFollowTopicList(int id);


    /*
    * @param topicId 话题id
    * @return int
    * @author kdj
    * @describe: 查询话题的被关注数量
    * @date 2023/3/9 11:17
    */
    int getFollowTopicNum(int topicId);

    /*
    * @param topicId 话题id
    * @param userId 用户id
    * @return entity.FollowTopicEntity
    * @author kdj
    * @describe:查询该用户是否关注过该话题
    * @date 2023/3/9 12:01
    */
    FollowTopicEntity getFollowByUserId(@Param("topicId") int topicId, @Param("userId") int userId);

    /*
    * @param followTopicEntity
    * @return int
    * @author kdj
    * @describe:修改关注话题状态
    * @date 2023/3/9 12:05
    */
    int upFollowStatus(FollowTopicEntity followTopicEntity);

    /*
     * @param followTopicEntity
     * @return int
     * @author kdj
     * @describe:添加关注话题数据
     * @date 2023/3/9 12:05
     */
    int addFollowTopic(FollowTopicEntity followTopicEntity);
}
